package com.gxl.butt;
import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
import sun.text.resources.iw.FormatData_iw_IL;

import java.io.*;

public class SerializeDemo
{
    public static void main(String [] args)
    {
        Employee e = new Employee();
        e.name = "Reyan Ali";
        e.address = "Phokka Kuan, Ambehta Peer";
        e.SSN = 11122333;
        e.number = 101;
        try
        {
            FileOutputStream fileOut =
                    new FileOutputStream("D://GG//employee.ser");

            ObjectOutputStream out = new ObjectOutputStream(fileOut);
            out.writeObject(e);
            out.close();
            fileOut.close();
            System.out.printf("Serialized data is saved in D:/tmp123/employee.ser");
        }catch(IOException i)
        {
            i.printStackTrace();
        }
    }
}
